<template>
    <div>
        <div class="search_template" style="background:white;height:120px;">
            <div
                class="content"
                style="height: 80px; display: flex; justify-content: space-around;align-items: center;"
            >
                <div>
                    <span style="color:#888; font-weight:800;">应用名称:</span>
                    <el-input
                        v-model="search"
                        placeholder="请输入应用名称"
                        @keyup.enter.native="onEnterSearch"
                        style="width:200px;height50px;"
                    />
                </div>
                <div align="right">
                    <el-button
                        size="mini"
                        icon="el-icon-search"
                        type="success"
                        @click="onEnterSearch"
                    >点击查询</el-button>
                </div>
            </div>
            <div align="left" style="margin-left:10px">
                <el-button
                    size="mini"
                    type="primary"
                    plain
                    icon="el-icon-plus"
                    @click="dialogFormVisible_two = true"
                >新增</el-button>
            </div>
        </div>
        <!-- <div>
		{{/api}}/portal/upfile/uploadFile
        </div>-->
        <el-container style="height: 530px; border: 1px solid #eee">
            <el-table :data="tableData" border="">
                <el-table-column align="center" label="应用类别" prop="menu_name"></el-table-column>
                <el-table-column align="center" label="应用类型" prop="type_name"></el-table-column>
                <el-table-column align="center" label="应用名称" prop="menu_button_name"></el-table-column>
                <el-table-column align="center" label="创建时间" prop="create_time"></el-table-column>
                <el-table-column align="center" label="状态" prop="is_disable"></el-table-column>
                <el-table-column align="center" width="300" label="操作">
                    <template slot-scope="scope">
                        <el-button
                            size="mini"
                            type="primary"
                            plain
                            @click="modify_display(scope.row.id)"
                        >修改</el-button>
                        <el-button
                            size="mini"
                            type="primary"
                            plain
                            @click="examine_examine(scope.row.id)"
                        >审核</el-button>
                        <el-button
                            size="mini"
                            type="danger"
                            plain
                            @click="prohibit_prohibit(scope.row.id)"
                        >禁用</el-button>
                        <el-button
                            size="mini"
                            style="margin:10px"
                            type="danger"
                            plain
                            @click="open(scope.row.id)"
                        >删除</el-button>
                    </template>
                </el-table-column>
            </el-table>
            <el-dialog title="新增功能" :visible.sync="dialogFormVisible_two" :before-close="close">
                <el-form
                    :model="dynamicValidateForm"
                    ref="dynamicValidateForm"
                    label-width="100px"
                    class="demo-dynamic"
                >
                    <el-form-item
                        label="应用类型"
                        :rules="[
			    { required: true, message: '请选择应用类型', trigger: 'blur' },
			  
			  ]"
                    >
                        <el-select v-model="value_two" @change="change_leixing" placeholder="请选择">
                            <el-option
                                v-for="item in options"
                                :key="item.id"
                                :label="item.typeName"
                                :value="item.id"
                            ></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item
                        label="应用类别"
                        :rules="[
			    { required: true, message: '请选择应用类别', trigger: 'blur' },
			  
			  ]"
                    >
                        <el-select v-model="value_three" placeholder="请选择">
                            <el-option
                                v-for="item in options_two"
                                :key="item.id"
                                :label="item.menuName"
                                :value="item.id"
                            ></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item
                        prop="apply_name"
                        label="应用名称"
                        :rules="[
			      { required: true, message: '请输入应用名称', trigger: 'blur' },
			    
			    ]"
                    >
                        <el-input v-model="dynamicValidateForm.apply_name"></el-input>
                    </el-form-item>
                    <el-form-item
                        label="应用简介"
                        prop="apply_desc"
                        :rules="[
				  { required: true, message: '请输入应用简介', trigger: 'blur' },
				
				]"
                    >
                        <el-input type="textarea" v-model="dynamicValidateForm.apply_desc"></el-input>
                    </el-form-item>
                    <el-form-item
                        prop="apply_number"
                        label="排序号"
                        :rules="[
				    { required: true, message: '请输入排序号', trigger: 'blur' },
				  
				  ]"
                    >
                        <el-input v-model="dynamicValidateForm.apply_number"></el-input>
                    </el-form-item>
                    <el-form-item
                        prop="menuButtonUrl"
                        label="应用地址"
                        :rules="[
				    { required: true, message: '请输入应用地址', trigger: 'blur' },
				  
				  ]"
                    >
                        <el-input v-model="dynamicValidateForm.menuButtonUrl"></el-input>
                    </el-form-item>
                    <!--上传图片-->
                    <el-form-item
                        prop="apply_number"
                        label="应用图标"
                        :rules="[
				    { required: true,  trigger: 'blur' },
				  
				  ]"
                    >
                        <el-upload
                            ref="new_upload"
                            action="/api/upfile/uploadFile"
                            list-type="picture-card"
                            :headers="token_token"
                            :on-success="upload_success"
                            name="file"
                            :on-preview="handlePictureCardPreview"
                            :on-remove="handleRemove"
                            :limit="1"
                        >
                            <i class="el-icon-plus"></i>
                        </el-upload>
                        <el-dialog :visible.sync="dialogVisible" :destroy-on-close="true">
                            <img width="100%" :src="dialogImageUrl" alt="">
                        </el-dialog>
                    </el-form-item>
                    <!--上传图片-->
                    <!--上传标题图片-->
                    <!-- <el-form-item
                        prop="apply_number"
                        label="应用标题"
                        :rules="[
				    { required: true,  trigger: 'blur' },
				  
				  ]"
                    >
                        <el-upload
                            ref="new_upload"
                            action="/api/upfile/uploadFile"
                            list-type="picture-card"
                            :headers="token_token"
                            :on-success="upload_success"
                            name="file"
                            :on-preview="handlePictureCardPreview"
                            :on-remove="handleRemove"
                            :limit="1"
                        >
                            <i class="el-icon-plus"></i>
                        </el-upload>
                        <el-dialog :visible.sync="dialogVisible" :destroy-on-close="true">
                            <img width="100%" :src="dialogImageUrl" alt="">
                        </el-dialog>
                    </el-form-item> -->
                    <!--上传标题图片-->
                    <el-form-item
                        label="推荐应用"
                        :rules="[
						  { required: true,  trigger: 'blur' },
						
						]"
                    >
                        <el-switch
                            v-model="value1"
                            active-text="否"
                            inactive-text="是"
                            active-value="1"
                            inactive-value="0"
                        ></el-switch>
                    </el-form-item>
                    <!--强制安装-->
                    <el-form-item
                        label="强制安装"
                        prop="ifMandatory"
                        :rules="[
						  { required: true,  trigger: 'blur' },
						
						]"
                    >
                        <el-switch
                            v-model="value2"
                            active-text="否"
                            inactive-text="是"
                            active-value="1"
                            inactive-value="0"
                        ></el-switch>
                    </el-form-item>
                    <el-form-item
                        label="是否隐藏"
                        :rules="[
						  { required: true,  trigger: 'blur' },
						
						]"
                    >
                        <el-switch
                            v-model="value3"
                            active-text="否"
                            inactive-text="是"
                            active-value="1"
                            inactive-value="0"
                        ></el-switch>
                    </el-form-item>
                    <!-- <el-form-item
                        label="应用范围"
                        :rules="[
				  { required: true, message: '请选择角色权限', trigger: 'blur' },
				
				]"
                        style="height:150px;overflow-y:scroll;"
                    >
                        <el-tree
                            :data="data"
                            show-checkbox
                            node-key="id"
                            ref="tree"
                            :expand-on-click-node="false"
                            :render-content="renderContent"
                        ></el-tree>
                    </el-form-item> -->
                </el-form>
                <div slot="footer" class="dialog-footer">
                    <el-button @click="close">取消</el-button>
                    <el-button type="primary" @click="new_onSubmit(dynamicValidateForm)">确定</el-button>
                </div>
            </el-dialog>
            <!--修改功能-->
            <!--修改功能-->
            <!--修改功能-->
            <el-dialog
                title="修改功能"
                :visible.sync="dialogFormVisible_three"
                :before-close="close_two"
            >
                <el-form
                    :model="dynamicValidateForm_modify"
                    ref="dynamicValidateForm_modify"
                    label-width="100px"
                    class="demo-dynamic"
                >
                    <el-form-item
                        label="应用类型"
                        change_leixing
                        :rules="[
				  { required: true, message: '请选择应用类型', trigger: 'blur' },
				
				]"
                    >
                        <el-select
                            v-model="value_four"
                            @change="change_leixing_two"
                            placeholder="请选择"
                        >
                            <el-option
                                v-for="item in options"
                                :key="item.id"
                                :label="item.typeName"
                                :value="item.id"
                            ></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item
                        label="应用类别"
                        :rules="[
				  { required: true, message: '请选择应用类别', trigger: 'blur' },
				
				]"
                    >
                        <el-select v-model="value_five" placeholder="请选择">
                            <el-option
                                v-for="item in options_three"
                                :key="item.id"
                                :label="item.menuName"
                                :value="item.id"
                            ></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item
                        prop="apply_name"
                        label="应用名称"
                        :rules="[
			      { required: true, message: '请输入应用名称', trigger: 'blur' },
			    
			    ]"
                    >
                        <el-input v-model="dynamicValidateForm_modify.apply_name"></el-input>
                    </el-form-item>
                    <el-form-item
                        label="应用简介"
                        prop="apply_desc"
                        :rules="[
				  { required: true, message: '请输入应用简介', trigger: 'blur' },
				
				]"
                    >
                        <el-input type="textarea" v-model="dynamicValidateForm_modify.apply_desc"></el-input>
                    </el-form-item>
                    <el-form-item
                        prop="apply_number"
                        label="排序号"
                        :rules="[
				    { required: true, message: '请输入排序号', trigger: 'blur' },
				  
				  ]"
                    >
                        <el-input v-model="dynamicValidateForm_modify.apply_number"></el-input>
                    </el-form-item>
                    <el-form-item
                        prop="menuButtonUrl"
                        label="应用地址"
                        :rules="[
			    { required: true, message: '请输入应用地址', trigger: 'blur' },
			  
			  ]"
                    >
                        <el-input v-model="dynamicValidateForm_modify.menuButtonUrl"></el-input>
                    </el-form-item>
                    <!--上传图片-->
                    <el-form-item
                        prop="apply_number"
                        label="应用图标"
                        :rules="[
				    { required: true,  trigger: 'blur' },
				  
				  ]"
                    >
                        <el-upload
                            action="/api/upfile/uploadFile"
                            ref="new_upload_upload"
                            list-type="picture-card"
                            :headers="token_token"
                            :on-success="upload_success_modify"
                            name="file"
                            :on-preview="handlePictureCardPreview_modify"
                            :on-remove="handleRemove_modify"
                            :limit="1"
                            :file-list="imgFilesList"
                        >
                            <i class="el-icon-plus"></i>
                        </el-upload>
                        <el-dialog :visible.sync="dialogVisible" :destroy-on-close="true">
                            <img width="100%" :src="dialogImageUrl" alt="">
                        </el-dialog>
                    </el-form-item>
                    <!--上传图片-->
                    <el-form-item
                        label="推荐应用"
                        :rules="[
						  { required: true,  trigger: 'blur' },
						
						]"
                    >
                        <el-switch
                            v-model="value1_two"
                            active-text="否"
                            inactive-text="是"
                            :active-value="1"
                            :inactive-value="0"
                        ></el-switch>
                    </el-form-item>
                    <!--强制安装-->
                    <el-form-item
                        label="强制安装"
                        :rules="[
						   { required: true, trigger: 'blur' },
						 
						 ]"
                    >
                        <el-switch
                            v-model="value2_two"
                            active-text="否"
                            inactive-text="是"
                            :active-value="1"
                            :inactive-value="0"
                        ></el-switch>
                    </el-form-item>
                    <el-form-item
                        label="是否隐藏"
                        :rules="[
						  { required: true,  trigger: 'blur' },
						
						]"
                    >
                        <el-switch
                            v-model="value3_two"
                            active-text="否"
                            inactive-text="是"
                            :active-value="1"
                            :inactive-value="0"
                        ></el-switch>
                    </el-form-item>
                    <!-- <el-form-item
                        label="应用范围"
                        :rules="[
				  { required: true, message: '请选择角色权限', trigger: 'blur' },
				
				]"
                        style="height:150px;overflow-y:scroll;"
                    >
                        <el-tree
                            :data="data"
                            show-checkbox
                            node-key="id"
                            :default-checked-keys="tree_display"
                            ref="tree_two"
                            :expand-on-click-node="false"
                            :render-content="renderContent"
                        ></el-tree>
                    </el-form-item> -->
                </el-form>
                <div slot="footer" class="dialog-footer">
                    <el-button
                        type="primary"
                        @click="onSubmit_modify(dynamicValidateForm_modify)"
                    >确定</el-button>
                    <el-button @click="close_two">取消</el-button>
                </div>
            </el-dialog>
            <!--修改功能-->
            <!--审核功能-->
            <el-dialog
                title="审核功能"
                :visible.sync="dialogFormVisible_thour"
                :before-close="close_three"
            >
                <el-form
                    :model="dynamicValidateForm_modify"
                    ref="dynamicValidateForm_modify"
                    label-width="100px"
                    class="demo-dynamic"
                >
                    <el-form-item
                        label="应用类型"
                        change_leixing
                        :rules="[
				  { required: true, message: '请选择应用类型', trigger: 'blur' },
				
				]"
                    >
                        <el-select
                            disabled
                            v-model="value_four"
                            @change="change_leixing_two"
                            placeholder="请选择"
                        >
                            <el-option
                                v-for="item in options"
                                :key="item.id"
                                :label="item.typeName"
                                :value="item.id"
                            ></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item
                        label="应用类别"
                        :rules="[
				  { required: true, message: '请选择应用类别', trigger: 'blur' },
				
				]"
                    >
                        <el-select disabled v-model="value_five" placeholder="请选择">
                            <el-option
                                v-for="item in options_three"
                                :key="item.id"
                                :label="item.menuName"
                                :value="item.id"
                            ></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item
                        prop="apply_name"
                        label="应用名称"
                        :rules="[
			      { required: true, message: '请输入应用名称', trigger: 'blur' },
			    
			    ]"
                    >
                        <el-input disabled v-model="dynamicValidateForm_modify.apply_name"></el-input>
                    </el-form-item>
                    <el-form-item
                        label="应用简介"
                        prop="apply_desc"
                        :rules="[
				  { required: true, message: '请输入应用简介', trigger: 'blur' },
				
				]"
                    >
                        <el-input
                            disabled
                            type="textarea"
                            v-model="dynamicValidateForm_modify.apply_desc"
                        ></el-input>
                    </el-form-item>
                    <el-form-item
                        prop="apply_number"
                        label="排序号"
                        :rules="[
				    { required: true, message: '请输入排序号', trigger: 'blur' },
				  
				  ]"
                    >
                        <el-input disabled v-model="dynamicValidateForm_modify.apply_number"></el-input>
                    </el-form-item>
                    <el-form-item
                        prop="menuButtonUrl"
                        label="应用地址"
                        :rules="[
				    { required: true, message: '请输入应用地址', trigger: 'blur' },
				  
				  ]"
                    >
                        <el-input disabled v-model="dynamicValidateForm_modify.menuButtonUrl"></el-input>
                    </el-form-item>
                    <!--应用图标-->
                    <el-form-item
                        prop="menuButtonUrl"
                        label="应用图标"
                        :rules="[
				    { required: true, trigger: 'blur' },
				  
				  ]"
                    >
                        <el-image
                            style="width: 50px; height: 50px"
                            :src="menuButtonIcon_two"
                            :fit="contain"
                        ></el-image>
                    </el-form-item>
                    <!--应用图标-->
                    <el-form-item
                        label="推荐应用"
                        :rules="[
						  { required: true,  trigger: 'blur' },
						
						]"
                    >
                        <el-switch
                            v-model="value1_two"
                            active-text="否"
                            inactive-text="是"
                            :active-value="1"
                            :inactive-value="0"
                            disabled
                        ></el-switch>
                    </el-form-item>
                    <!--强制安装-->
                    <el-form-item
                        label="强制安装"
                        :rules="[
						  { required: true,  trigger: 'blur' },
						
						]"
                    >
                        <el-switch
                            v-model="value2_two"
                            active-text="否"
                            inactive-text="是"
                            :active-value="1"
                            :inactive-value="0"
                            disabled
                        ></el-switch>
                    </el-form-item>
                    <el-form-item
                        label="是否隐藏"
                        :rules="[
						  { required: true,  trigger: 'blur' },
						
						]"
                    >
                        <el-switch
                            v-model="value3_two"
                            active-text="否"
                            inactive-text="是"
                            :active-value="1"
                            :inactive-value="0"
                            disabled
                        ></el-switch>
                    </el-form-item>
                    <!-- <el-form-item
                        label="应用范围"
                        :rules="[
				  { required: true, message: '请选择角色权限', trigger: 'blur' },
				
				]"
                        style="height:150px;overflow-y:scroll;"
                    >
                        <el-tree
                            :data="data"
                            show-checkbox
                            node-key="id"
                            :default-checked-keys="tree_display_two"
                            ref="tree_three"
                            :expand-on-click-node="false"
                            :render-content="renderContent"
                        ></el-tree>
                    </el-form-item> -->
                </el-form>
                <div slot="footer" class="dialog-footer">
                    <el-button type="primary" @click="onSubmit_examine()">审核通过</el-button>
                    <el-button @click="close_three">取消</el-button>
                </div>
            </el-dialog>
            <!--审核功能-->
            <!-- <el-container style="display:inline-block"> -->
            <!--分页的实现-->
        </el-container>
        <el-container style="margin-top:20px;margin-bottom:20px;float:right;margin-right:20px">
            <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="currentPage"
                :page-sizes="[5, 10, 20, 40]"
                :page-size="pagesize"
                layout="total,sizes, prev, pager, next, jumper"
                :total="total_one"
            ></el-pagination>
        </el-container>
    </div>
</template>
<style>
.el-header {
    background-color: #b3c0d1;
    color: #333;
    line-height: 60px;
}

.el-aside {
    color: #333;
}
</style>

<script>
import {
    getUserInfo,
    deleteUser,
    getUserJurisdiction,
    add_role_role,
    get_role_jurisdiction,
    getModifyUserInfo,
    modify_role_role,
    get_application_application,
    get_category_type_drop_down,
    application_category_application,
    add_application_category_application,
    get_organization_tree,
    display_display_application,
    modify_modify_application,
    delect_delect_application,
    prohibit_prohibit_application,
    examine_examine_application,
    search_search_application
} from '@/api/user';
var token_one = sessionStorage.getItem('token');
export default {
    data() {
        return {
            tableData: [],
            search: '',
            dialogTableVisible: false,
            dialogFormVisible: false,
            dialogTableVisible_two: false,
            dialogFormVisible_two: false,
            dialogTableVisible_three: false,
            dialogFormVisible_three: false,
            /******审核********/
            dialogFormVisible_thour: false,
            /*****添加功能的form******/
            dynamicValidateForm: {
                apply_name: '',
                apply_desc: '',
                apply_number: '',
                menuButtonUrl: ''
            },
            /******添加功能的form****/
            /******修改的form*******/
            dynamicValidateForm_modify: {
                apply_name: '',
                apply_desc: '',
                apply_number: '',
                menuButtonUrl: ''
            },
            role_id_id: '',
            /******修改的form*******/
            options: '',
            data: [],
            value1: 0,
            value2: 0,
            value3: 0,
            value4: 0,
            value_two: '',
            value_three: '',
            options_two: '',
            /*****修改功能******/
            // value11:,

            value1_two: 0,
            value2_two: 0,
            value3_two: 0,
            value4_two: 0,
            value_four: '',
            value_five: '',
            options_three: '',
            value_value: true,
            /*****修改功能*****/
            /********分页数据********/
            currentPage: 1,
            pagesize: 10,
            total_one: 0,
            /********分页数据*******/
            /******上传图片********/
            dialogImageUrl: '',
            dialogVisible: false,
            menuButtonIcon_one: '',
            /******上传图片*******/
            token_token: { Authorization: token_one },
            // imgFilesList:[
            //  {url:"http://192.168.1.114:8080/profile/2020/04/28/0b417fbaefc93d16db28f021794472cb.jpg"}
            //  ]
            imgFilesList: [],
            /******树的回显*****/
            tree_display: [],
            tree_display_two: []
            /*****树的回显*******/
        };
    },

    /********获取用户列表***********/
    created() {
        // var getUserInfo_params={
        // 	token: "eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjM5MzczZDUwLWRkZWUtNDMzOC1iNWE1LWI5OGE0NzBjNzY3NSJ9.s-rok9MHQpnLH8unFriyHwc8_8NBFeCR7zzj-sgbdUR9u-QZxu-zINqGOj2Okv74UftPbro2pAqTYrGtwPfbjw"
        // }
        this.load_jiaose_list();
        this.get_type_drop_down();
        /*******获取它的权限**********/

        /********获取它的权限*********/

        var data_data = {
            deptId: 1
        };

        get_organization_tree(data_data)
            .then(response => {
                if (response.data.code == 200) {
                    this.data = response.data.depts;
                } else {
                    this.$message.error(response.data.msg);
                }
            })
            .catch(() => {});
        /**********获取添加角色里的权限***********/
    },
    /********获取用户列表**********/
    /**********删除功能***************/
    methods: {
        close() {
            this.$refs.dynamicValidateForm.resetFields();
            this.dialogFormVisible_two = false;
            (this.value1 = 0),
                (this.value2 = 0),
                (this.value3 = 0),
                (this.value4 = 0),
                // this.role_id_id=""
                (this.value_two = '');
            this.value_three = '';
            this.$refs.tree.setCheckedKeys([]);
            this.$refs.new_upload.clearFiles();
        },
        close_two() {
            this.dialogFormVisible_three = false;
            console.log('关闭');
            this.imgFilesList = [];
            this.$refs.new_upload_upload.clearFiles();
            this.$refs.tree_two.setCheckedKeys([]);
            (this.value1_two = 0), (this.value2_two = 0), (this.value3_two = 0), (this.value4_two = 0), (this.value_four = '');
            this.value_five = '';
            this.tree_display = [];
        },
        close_three() {
            this.tree_display_two = [];
            this.$refs.tree_three.setCheckedKeys([]);
            this.dialogFormVisible_thour = false;
        },
        /******导航栏跳转功能********/
        handleSelect() {},
        handleOpen(key, keyPath) {},
        handleClose(key, keyPath) {},
        /******导航栏跳转功能*********/
        open(index) {
            this.$confirm('您确定要删除这条信息吗?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning',
                center: true
            })
                .then(() => {
                    /*****点击了确认*******/

                    var roleId = {
                        id: index
                    };

                    delect_delect_application(roleId)
                        .then(response => {
                            if (response.data.code == 200) {
                                this.load_jiaose_list();
                                this.$message({
                                    message: '删除成功',
                                    type: 'success'
                                });
                            } else {
                                this.$message.error(response.data.msg);
                            }
                        })
                        .catch(() => {});
                    /******点击了确认********/
                })
                .catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消删除'
                    });
                });
        },
        /********删除功能****************/
        /**********修改功能数据回显*************/

        onSubmit() {},

        /**********修改功能数据回显*************/
        /*******树形结构********/
        renderContent(h, { node, data, store }) {
            return (
                <span class="custom-tree-node">
                    <span>{node.label}</span>
                </span>
            );
        },

        /********树形结构**********/
        /**********添加角色的功能****************/
        new_onSubmit(dynamicValidateForm) {
            this.dialogFormVisible_two = false;
            // this.$refs[dynamicValidateForm].validate((valid) => {
            var new_add_params = {
                applyTypeId: this.value_two,
                buttonParentId: this.value_three,
                menuButtonUrl: dynamicValidateForm.menuButtonUrl,
                menuButtonName: dynamicValidateForm.apply_name,
                synopsis: dynamicValidateForm.apply_desc,
                buttonSort: dynamicValidateForm.apply_number,
                menuButtonIcon: this.menuButtonIcon_one,
                recommendApply: this.value1,
                ifMandatory: this.value2,
                isShow: this.value3,
                ifUp: this.value4,
                ids: this.$refs.tree.getCheckedKeys()
            };
            console.log('我需要博阳的数据', new_add_params);
            /******数据清空**********/

            this.enuButtonIcon_one = '';
            (this.value1 = 0), (this.value2 = 0), (this.value3 = 0), (this.value4 = 0), (this.role_id_id = '');
            this.value_two = '';
            this.value_three = '';
            this.$refs['dynamicValidateForm'].resetFields();
            this.$refs.new_upload.clearFiles();
            /*******数据清空*********/

            add_application_category_application(new_add_params)
                .then(response => {
                    if (response.data.code == 200) {
                        this.load_jiaose_list();
                        this.$message({
                            message: '添加成功',
                            type: 'success'
                        });
                    } else {
                        this.$message.error(response.data.msg);
                    }
                })
                .catch(() => {});
            /*******调用新增接口*********/
        },
        /*********添加角色的功能**************/
        /********加载角色列表********/
        load_jiaose_list() {
            var params_list = {
                pageNum: this.currentPage,
                pageSize: this.pagesize
            };
            get_application_application(params_list)
                .then(response => {
                    if (response.data.code == 200) {
                        console.log('我需要的数京津冀', response);
                        this.tableData = response.data.data.list;
                        this.total_one = response.data.data.total;
                    } else {
                        this.$message.error(response.data.msg);
                    }
                })
                .catch(() => {});
        },
        /*******加载角色列表********/
        /**********角色修改功能*************/
        /********修改数据回显********/
        modify_display(role_id) {
            this.role_id_id = role_id;
            this.dialogFormVisible_three = true;
            var getUserInfo_params = {
                id: role_id
            };

            display_display_application(getUserInfo_params)
                .then(response => {
                    console.log('我需要的回显数据===---', response);
                    if (response.data.code == 200) {
                        this.value1_two = response.data.data.applyDetailsId.recommendApply;
                        var tree_data = response.data.data.application;
                        console.log('tree_data', response.data.data.application);
                        var arr_one = [];
                        for (let item of tree_data) {
                            arr_one.push(item.deptId);
                        }
                        this.tree_display = arr_one;
                        console.log('tree_data_two', this.tree_display);
                        this.value2_two = response.data.data.applyDetailsId.ifMandatory;
                        this.value3_two = response.data.data.applyDetailsId.isShow;
                        this.value4_two = response.data.data.applyDetailsId.ifUp;
                        this.dynamicValidateForm_modify.apply_name = response.data.data.applyDetailsId.menuButtonName;
                        let obj_one = new Object();
                        obj_one.url = response.data.data.applyDetailsId.menuButtonIcon;
                        this.imgFilesList.push(obj_one);
                        /****回显的图片******/
                        this.menuButtonIcon_two = response.data.data.applyDetailsId.menuButtonIconNoIp;
                        /*****回显的图片******/
                        console.log('+++++我特别需要的回显数据', this.imgFilesList);
                        this.dynamicValidateForm_modify.apply_desc = response.data.data.applyDetailsId.synopsis;
                        this.dynamicValidateForm_modify.apply_number = response.data.data.applyDetailsId.buttonSort;
                        /*******四个switch**********/
                        this.dynamicValidateForm_modify.menuButtonUrl = response.data.data.applyDetailsId.menuButtonUrl;
                        // this.value4_two=1
                        /*******四个switch*********/
                    } else {
                        this.$message.error(response.data.msg);
                    }
                })
                .catch(() => {});
        },
        /********修改数据的回显********/
        onSubmit_modify(dynamicValidateForm_modify) {
            this.dialogFormVisible_three = false;
            // this.$refs[dynamicValidateForm].validate((valid) => {

            var new_add_params = {
                id: this.role_id_id,
                applyTypeId: this.value_four,
                buttonParentId: this.value_five,
                menuButtonName: dynamicValidateForm_modify.apply_name,
                synopsis: dynamicValidateForm_modify.apply_desc,
                buttonSort: dynamicValidateForm_modify.apply_number,
                recommendApply: this.value1_two,
                ifMandatory: this.value2_two,
                isShow: this.value3_two,
                ifUp: this.value4_two,
                ids: this.$refs.tree_two.getCheckedKeys(),
                menuButtonIcon: this.menuButtonIcon_two,
                menuButtonUrl: dynamicValidateForm_modify.menuButtonUrl
            };
            /******数据清空**********/
            this.tree_display = [];
            this.value1_two = 0;
            this.value2_two = 0;
            this.value3_two = 0;
            this.value4_two = 0;
            this.role_id_id = '';
            this.value_four = '';
            this.value_five = '';
            this.menuButtonIcon_two = '';
            this.$refs['dynamicValidateForm_modify'].resetFields();
            this.imgFilesList = [];
            this.$refs.new_upload_upload.clearFiles();
            /*******数据清空*********/
            modify_modify_application(new_add_params)
                .then(response => {
                    if (response.data.code == 200) {
                        this.load_jiaose_list();
                        this.$message({
                            message: '修改成功',
                            type: 'success'
                        });
                    } else {
                        this.$message.error(response.data.msg);
                    }
                })
                .catch(() => {});
            /*******调用新增接口*********/
        },
        /*********角色修改功能************/
        /*********查询应用类型表**************/
        get_type_drop_down() {
            get_category_type_drop_down()
                .then(response => {
                    if (response.data.code == 200) {
                        this.options = response.data.data;
                    } else {
                        this.$message.error(response.data.msg);
                    }
                })
                .catch(() => {});
        },
        /*****根据应用类型加载应用类别******/
        change_leixing() {
            var new_add_params = {
                id: this.value_two
            };
            application_category_application(new_add_params)
                .then(response => {
                    if (response.data.code == 200) {
                        this.options_two = response.data.data;
                        // this.load_jiaose_list()
                        //   this.$message({
                        //           message: '修改成功',
                        //           type: 'success'
                        //      });
                    } else {
                        this.$message.error(response.data.msg);
                    }
                })
                .catch(() => {});
        },
        change_leixing_two() {
            var new_add_params = {
                id: this.value_four
            };
            application_category_application(new_add_params)
                .then(response => {
                    if (response.data.code == 200) {
                        this.options_three = response.data.data;
                    } else {
                        this.$message.error(response.data.msg);
                    }
                })
                .catch(() => {});
        },
        /************禁用功能************/
        prohibit_prohibit(id) {
            var new_add_params = {
                id: id,
                type: 1
            };

            prohibit_prohibit_application(new_add_params)
                .then(response => {
                    if (response.data.code == 200) {
                        this.load_jiaose_list();
                        this.$message({
                            message: '禁用成功',
                            type: 'success'
                        });
                    } else {
                        this.$message.error(response.data.msg);
                    }
                })
                .catch(() => {});
        },
        /************禁用功能***********/
        /***********审核功能*************/

        examine_examine(role_id) {
            this.role_id_id = role_id;
            this.dialogFormVisible_thour = true;
            var getUserInfo_params = {
                id: role_id
            };

            display_display_application(getUserInfo_params)
                .then(response => {
                    if (response.data.code == 200) {
                        var tree_data = response.data.data.application;
                        console.log('tree_data', response.data.data.application);
                        var arr_one = [];
                        for (let item of tree_data) {
                            arr_one.push(item.deptId);
                        }
                        this.tree_display_two = arr_one;
                        /*******两个下拉选中********/
                        (this.value_four = response.data.data.applyDetailsId.applyTypeId),
                            (this.value_five = response.data.data.applyCategoryName.menu_name);
                        /******两下拉选中*******/
                        this.dynamicValidateForm_modify.apply_name = response.data.data.applyDetailsId.menuButtonName;
                        this.menuButtonIcon_two = response.data.data.applyDetailsId.menuButtonIconNoIp;
                        this.dynamicValidateForm_modify.apply_desc = response.data.data.applyDetailsId.synopsis;
                        this.dynamicValidateForm_modify.apply_number = response.data.data.applyDetailsId.buttonSort;
                        /*******四个switch**********/
                        this.value1_two = response.data.data.applyDetailsId.recommendApply;
                        this.value2_two = response.data.data.applyDetailsId.ifMandatory;
                        this.value3_two = response.data.data.applyDetailsId.isShow;
                        this.value4_two = response.data.data.applyDetailsId.ifUp;
                        this.dynamicValidateForm_modify.menuButtonUrl = response.data.data.applyDetailsId.menuButtonUrl;
                        /*******四个switch*********/
                    } else {
                        this.$message.error(response.data.msg);
                    }
                })
                .catch(() => {});
        },
        /***********审核功能************/
        onSubmit_examine() {
            this.dialogFormVisible_thour = false;
            var new_add_params = {
                id: this.role_id_id,
                type: 1
            };
            this.tree_display_two = [];
            this.$refs.tree_three.setCheckedKeys([]);
            examine_examine_application(new_add_params)
                .then(response => {
                    if (response.data.code == 200) {
                        this.load_jiaose_list();
                        this.$message({
                            message: '审核通过',
                            type: 'success'
                        });
                    } else {
                        this.$message.error(response.data.msg);
                    }
                })
                .catch(() => {});
        },
        /************审核****************/
        /************模糊查询搜索功能***************/
        onEnterSearch(e, searchVal) {
            /***********调用模糊查询接口***************/

            var new_add_params = {
                pageNum: 1,
                pageSize: 10,
                menuButtonName: this.search
            };

            search_search_application(new_add_params)
                .then(response => {
                    if (response.data.code == 200) {
                        this.tableData = response.data.data.list;
                        this.$message({
                            message: '查询成功',
                            type: 'success'
                        });
                    } else {
                        this.$message.error(response.data.msg);
                    }
                })
                .catch(() => {});
            /*********调用模糊查询的接口**************/
        },
        /**********模糊查询搜索功能****************/
        /*******根据应用类型加载应用类别***/
        /************分页的数据***************/
        handleSizeChange: function(size) {
            this.pagesize = size;
            this.load_jiaose_list();
        },
        handleCurrentChange: function(currentPage) {
            this.currentPage = currentPage;
            this.load_jiaose_list();
        },
        /************分页的数据*************/
        /**********图片上传功能**************/
        handleRemove(file) {
            console.log(file);
        },
        handlePictureCardPreview(file) {
            this.dialogImageUrl = file.url;
            console.log('==我需要的数据==', file);
            this.dialogVisible = true;
        },
        /******上传图片成功*********/
        upload_success(file) {
            console.log('===我是图片上传成功====', file);
            this.menuButtonIcon_one = file.filePath;
        },
        /********上传图片成功***********/
        handleRemove_modify(file) {
            console.log(file);
        },
        handlePictureCardPreview_modify(file) {
            this.dialogImageUrl = file.url;
            console.log('==我需要的数据==', file);
            this.dialogVisible = true;
        },
        /******上传图片成功*********/
        upload_success_modify(file) {
            console.log('===我是图片上传成功====', file);
            this.menuButtonIcon_two = file.filePath;
        }
        /**********图片上传功能*************/
        /*********查询应用类型表*************/
    }
};
</script>
<style scoped>
</style>
